Welcome Guest | Sign in | Register

Home > C Programming > Inbuilt Functions > Questions and Answers

01. What is the output of following program?
void main(){
int a;
a=453<<16;
printf("%d",a);
}
A. 0 B. 1
C. -1 D. none of these

Answer and Explanation

Answer: 0

Explanation:
There is no explanation...

Report Errors

Name:

Loading...

VView Answer | RReport | DDiscuss in Forum
02. What will be output of following program?
#include
#include
int main(){
char *ptr1 = NULL;
char *ptr2 = 0;
strcpy(ptr1," c");
strcpy(ptr2,"questions");
printf("\n%s %s",ptr1,ptr2);
return 0;
}  
A. c questions B. c (null)
C. (null) (null) D. Compilation error
E. None of above

Answer and Explanation

Answer: (null) (null)

Explanation:
We cannot assign any string constant in null pointer by strcpy function.

Report Errors

Name:

Loading...

VView Answer | RReport | DDiscuss in Forum
03. What will be output of following c code?
#include
int main(){
int *p1,**p2;
double *q1,**q2;
printf("%d %d ",sizeof(p1),sizeof(p2)); printf("%d %d",sizeof(q1),sizeof(q2));
getch();
return 0;
}  
A. 1 2 4 8 B. 2 4 4 8
C. 2 4 2 4 D. 2 2 2 2
E. 2 2 4 4

Answer and Explanation

Answer: 2 2 2 2

Explanation:
Size of any type of pointer is 2 byte (In case of near pointer)

Report Errors

Name:

Loading...

VView Answer | RReport | DDiscuss in Forum
04. Which of the following function sets first n characters of a string to a given character?
A. strinit() B. strnset()
C. strset() D. strcset()

Answer and Explanation

Answer: strnset()

Explanation:
There is no explanation...

Report Errors

Name:

Loading...

VView Answer | RReport | DDiscuss in Forum
05. The library function used to find the last occurrence of a character in a string is?
A. strnstr() B. laststr()
C. strrchr() D. strstr()

Answer and Explanation

Answer: strrchr()

Explanation:
There is no explanation...

Report Errors

Name:

Loading...

VView Answer | RReport | DDiscuss in Forum
06. How can we release the allocated memory?
A. remove(var-name); B. free(var-name);
C. delete(var-name); D. dalloc(var-name);

Answer and Explanation

Answer: free(var-name);

Explanation:
There is no explanation...

Report Errors

Name:

Loading...

VView Answer | RReport | DDiscuss in Forum
07. islower() method is used for?
A. check for lowercase character or not B. conversion for lowercase to uppercase
C. convert to lowercase to uppercase D. None

Answer and Explanation

Answer: check for lowercase character or not

Explanation:
There is no explanation...

Report Errors

Name:

Loading...

VView Answer | RReport | DDiscuss in Forum
08. tolower() method is used for?
A. convert the upper case character to lower case B. convert the lower case character to upper case
C. both D. None

Answer and Explanation

Answer: convert the upper case character to lower case

Explanation:
There is no explanation...

Report Errors

Name:

Loading...

VView Answer | RReport | DDiscuss in Forum
09. Which method is used for addition of two strings?
A. strcpy B. strcat
C. strcmp D. strlen

Answer and Explanation

Answer: strcat

Explanation:
There is no explanation...

Report Errors

Name:

Loading...

VView Answer | RReport | DDiscuss in Forum
10. Which one is used for find the length of string?
A. strcpy B. strlen
C. strcmp D. None

Answer and Explanation

Answer: strlen

Explanation:
There is no explanation...

Report Errors

Name:

Loading...

VView Answer | RReport | DDiscuss in Forum



Partner Sites
LucentBlackBoard.com                  SoftLucent.com                  LucentJobs.com
All rights reserved © 2012-2015 SoftLucent.